<template>
    <div class="layerRtb layerRtb-threecolumn">
        <three-title :title="{name:'APP'}"></three-title>
        <div class="layerRtb-scroll thinScroll" v-scrollHeight="437">
            <div class="analyItem">
                <p class="analyItemTit tx-center">APP</p>
                <div class="analyItemCon"  v-if="flg==1">
                    <p class="col-md-4">激活： <span class="cLightGray pr8">{{ Number(this.stageInfo.activation_app) === 0 ? '已激活' : '未激活' }}</span></p>
                    <div class="imgbox imgbox1 col-md-3" style="position: absolute;margin-top: -10px;top:24px;right:0px">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg=0">
                    </div>
                </div>
                <div class="analyItemCon" v-else>
                    <p class="col-md-4">激活 <span class="cLightGray pr8"></span> </p>
                    <div stype="1" class="problemList">
                        <p class="fl col-md-4 mb10">
                            <select aid="15" name="set_pm_standard_user" pm_standard_user_sdid="30" spsuid="30" class="problemListStype1" v-model="activation_app">
                                <option value="">-请选择-</option>
                                <option value="0">是</option>
                                <option value="1">否</option>
                            </select>
                        </p>
                    </div>
                    <div class="imgbox imgbox2 " style="margin-top: 15px;">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateStageInfo()">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg=1">
                    </div>
                </div>
            </div>
        </div>

        <div class="layerRtb-footer">
              <div class="analyItem">
                <p class="analyItemTit tx-center">综合</p>
                <div class="analyItemCon">
                </div>
            </div>
        </div>
          <transition-group class="animated faster" enter-active-class="animated faster slideInRight" leave-active-class="animated faster slideOutRight">
         </transition-group>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import { updateStageInfoByleId } from '../../Resources/Api/index'
export default {
    components: {
    },
    data () {
        return {
            flg: 1,
            stageInfo: {},
            activation_app: -1 // 是否激活：0-是，1-否
        }
    },
    created () {
        this.stageInfo = this.$route.query.stageInfo
        this.activation_app = this.stageInfo.activation_app
    },
    methods: {
        // 认知阶段修改用户的激活状态
        updateStageInfo () {
            updateStageInfoByleId({
                uid: this.leftInfo.uid, // 用户id
                activationApp: this.activation_app // 激活状态
            }).then(result => {
                // debugger
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('修改成功')
                    this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('认知阶段修改用户的年龄和婚姻状态失败，异常信息：' + err)
            })
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    watch: {
    }
}

</script>
